package com.yingxin.yxerp.module.tplus.auth.task;

import com.yingxin.yxerp.module.tplus.auth.service.IAuthService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 刷新t+ token
 */
@Slf4j
@Component
public class TplusRefreshTokenTask {

    @Autowired
    private IAuthService authService;

    // 5 天
    @Scheduled(fixedDelay = 1000 * 60 * 60 * 24 * 5)
    public void refreshToken() {
        try {
            authService.refreshToken();
        } catch (Exception e) {
        }
    }

}
